<?php

$youtube = json_decode(file_get_contents('https://gdata.youtube.com/feeds/api/videos?v=2&alt=jsonc&time=all_time&orderby=published&q=joaogandinirp'), true);
//debug($youtube);
$count_i = 0;
echo '<div class="titulo col-xs-12">
		<span class="cinza">Vi</span><span class="azul">deos</span>
	</div>';
foreach ($youtube['data']['items'] as $key => $value) {
    if ($count_i < 4) {
        if ($key == 0) {
            echo '<div class="item_conteudo col-xs-12 col-md-9">
		<iframe src="//www.youtube.com/embed/' . $value['id'] . '" allowfullscreen="" frameborder="0" height="270" width="370"></iframe>
	</div>
	<div class="galeria_home col-xs-12 col-md-3">';
        } else {
            echo '<img src="' . $value['thumbnail']['sqDefault'] . '" title="' . $value['title'] . '" border="0" />';
        }
    }
    $count_i++;
}
echo '</div>';
?>